#include <REGX52.H>
#include "LCD1602.h"
#include "IR.h"

int Num;

void main(){
	IR_Init();
	LCD1602_Init();
	while(1)
	{
		if(IR_GetDataFlag() || IR_GetRepeatFlag())
		{
			LCD1602_PrintHexNum(1,1,IR_GetAddress(),2);
			LCD1602_PrintHexNum(1,4,IR_GetCommand(),2);
			if(IR_GetCommand()==0x15)
			{
				Num--;
			}
			if(IR_GetCommand()==0x09)
			{
				Num++;
			}
			
		}
		LCD1602_PrintSignedNum(2, 1, Num, 3);
	}
}

